﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Model;
using BLL;

namespace BookManage
{
    public partial class frmAddBook : Form
    {
        public Book book = null;
        public frmAddBook()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            book = new Book();
            book.BookId = BookServices.GetBookCount();
            book.Name = txtBookName.Text;
            book.Price = Convert.ToInt32(txtPrice.Text);
            book.Publiser = txtPubliser.Text;
            book.BorrowCount = Convert.ToInt32(txtBookCount.Text);
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void frmAddBook_Load(object sender, EventArgs e)
        {

        }
    }
}
